package src.com.foreknow.demo3;

import  java.util.Scanner;

/**
 * 嵌套if
 */

public class CnotrollDemo6 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入是否是会员：（y/n）");
        String idn = input.next();
        System.out.println("请输入金额：");
        double money = input.nextDouble();
        if (idn.equals("y")) { //会员
            if (money > 2000) {
                money = money * 0.75;
            } else {
                money = money * 0.8;
            }
        } else {//非会员
            if (money > 100) {
                money = money * 0.9;
            }
        }
        System.out.println("实际支付：" + money);
    }
}
